package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.InHospitalPatientQuery;
import com.mk.admin.model.vo.InHospitalPatientVo;
import com.mk.admin.service.InHospitalPatientService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/inHospitalPatient")
@Api(tags = "住院患者")
public class InHospitalPatientController  {
    @Autowired
    private InHospitalPatientService inHospitalPatientService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody InHospitalPatientQuery query) {
        return inHospitalPatientService.select(query);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody InHospitalPatientVo inHospitalPatientVo) {
        return inHospitalPatientService.add(inHospitalPatientVo);
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody InHospitalPatientVo inHospitalPatientVo) {
        return inHospitalPatientService.update(inHospitalPatientVo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody InHospitalPatientVo inHospitalPatientVo) {
        return inHospitalPatientService.delete(inHospitalPatientVo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody InHospitalPatientVo inHospitalPatientVo) {
        return inHospitalPatientService.status(inHospitalPatientVo.getId());
    }

}
